﻿@model IList<MvcApplication1.Models.SanPhamModel>
@{
    ViewBag.Title = "ThietBiDiDong";
    Layout = "~/Views/MasterPage/Main.cshtml";
    ViewBag.ActiveIndex = 0;
}

<section>
    <div>
        <div class="search search-absolute">
		    <input placeholder="TÌM KIẾM" type="search" class="search-box">
            <i class="icon-search"></i>
        </div>
        <ul class="product-list">
            @foreach(var product in Model) {
                <li class="product-item">
                    <a href="javascript:void(0);" alt="Nokia Lumia 520" class="product-link">
                        <div class="product-img">
                            <img src="@product.image" alt="Nokia Lumia 520" />
                        </div>
                        <div class="product-info">
                            <h3 class="product-name">@product.tenSanPham</h3>
                            <div class="product-price">
                                <cite>@product.giaSanPham</cite>
                            </div>
                        </div>
                    </a>
                    <a href="javascript:void(0);" alt="Nokia Lumia 520" class="product-link-hover">
                        <h3 class="product-name">@product.tenSanPham</h3>
                        <div class="product-price">
                            <cite>@product.giaSanPham</cite>
                        </div>
                        <p class="product-details">@product.thongTinChiTiet</p> 
                    </a>
                </li>
            }
        </ul>
    </div>
</section>
<script>
    $('.icon-search').click(function () {
        var keyword = $('.search-box').val();
        $('<form action="/SanPham/TimKiem" method="GET">' + '<input type="hidden" name="keyword" value="' + keyword + '"><input type="hidden" name="type" value="1"></form>').submit();
    });
</script>